package pw.hais.etgsh.adapter;

import android.widget.ImageView;
import android.widget.TextView;

import java.util.List;

import pw.hais.app.AppAdapter;
import pw.hais.etgsh.R;
import pw.hais.etgsh.model.GuShiTypeModel;

/**
 * Created by Hais1992 on 2015/12/14.
 */
public class GuShiTypeAdapter extends AppAdapter<GuShiTypeModel, GuShiTypeAdapter.ViewHolder> {


    public GuShiTypeAdapter(List<GuShiTypeModel> mList, Class<ViewHolder> mHolderClass) {
        super(mList, R.layout.activity_main_gslx_item, mHolderClass);
    }

    @Override
    public void onBindView(int position, ViewHolder mViewHolder, GuShiTypeModel mItem) {
       mViewHolder.image_icon.setImageResource(mItem.image);
       mViewHolder.text_title.setText(mItem.title);
       mViewHolder.text_content.setText(mItem.content);
    }

    //反射免FindViewById，名称必须和 XML的 控件ID一样
    public static class ViewHolder extends AppAdapter.ViewHolder {
        public TextView text_title;
        public TextView text_content;
        public ImageView image_icon;
    }
}
